﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using CCWin;

namespace weiqijiance
{
    public partial class 检测方法自检 : CCSkinMain
    {
        public 检测方法自检()
        {
            InitializeComponent();
        }
        public mainform m_mainform;
        private void button1_Click(object sender, EventArgs e)
        {
            iniclass objini = new iniclass();
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + "\\检测自检\\自由加速设备自检信息.ini";
            string path1 = string.Format(@"{0}", path);
            objini.Ini(path1);
            model.尾气自检.检测前自检.zijianzyjs objzj = new model.尾气自检.检测前自检.zijianzyjs();
            objzj.bzjbz = true;
            objzj.StationCode = m_mainform.stationCode;
            objzj.SceneCode = m_mainform.lineCode;
            objzj.N0 = objini.ReadValue("记录", "N0").Trim();
            objzj.N0_Error = objini.ReadValue("记录", "N0_Error").Trim();
            objzj.N0_Judge = objini.ReadValue("记录", "N0_Judge").Trim();
            objzj.N30 = objini.ReadValue("记录", "N30").Trim();
            objzj.N30_Error = objini.ReadValue("记录", "N30_Error").Trim();
            objzj.N30_Judge = objini.ReadValue("记录", "N30_Judge").Trim();
            objzj.N50 = objini.ReadValue("记录", "N50").Trim();
            objzj.N50_Error = objini.ReadValue("记录", "N50_Error").Trim();
            objzj.N50_Judge = objini.ReadValue("记录", "N50_Judge").Trim();
            objzj.N70 = objini.ReadValue("记录", "N70").Trim();
            objzj.N70_Error = objini.ReadValue("记录", "N70_Error").Trim();
            objzj.N70_Judge = objini.ReadValue("记录", "N70_Judge").Trim();
            objzj.N90 = objini.ReadValue("记录", "N90").Trim();
            objzj.N90_Error = objini.ReadValue("记录", "N90_Error").Trim();
            objzj.N90_Judge = objini.ReadValue("记录", "N90_Judge").Trim();
            objzj.N100 = objini.ReadValue("记录", "N100").Trim();
            objzj.N100_Error = objini.ReadValue("记录", "N100_Error").Trim();
            objzj.N100_Judge = objini.ReadValue("记录", "N100_Judge").Trim();
            objzj.N1000 = objini.ReadValue("记录", "N1000").Trim();
            objzj.N1000_Error = objini.ReadValue("记录", "N1000_Error").Trim();
            objzj.N1000_Judge = objini.ReadValue("记录", "N1000_Judge").Trim();
            objzj.N1500 = objini.ReadValue("记录", "N1500").Trim();
            objzj.N1500_Error = objini.ReadValue("记录", "N1500_Error").Trim();
            objzj.N1500_Judge = objini.ReadValue("记录", "N1500_Judge").Trim();
            objzj.N2000 = objini.ReadValue("记录", "N2000").Trim();
            objzj.N2000_Error = objini.ReadValue("记录", "N2000_Error").Trim();
            objzj.N2000_Judge = objini.ReadValue("记录", "N2000_Judge").Trim();
            objzj.Judge = objini.ReadValue("记录", "Judge").Trim();
            //objzj.CheckTimeStart = objini.ReadValue("记录", "CheckTimeStart").Trim();
            //objzj.CheckTimeEnd = objini.ReadValue("记录", "CheckTimeEnd").Trim();
            objzj.CheckTimeStart = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker1.Value.ToString("HH:mm:ss");
            objzj.CheckTimeEnd = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker2.Value.ToString("HH:mm:ss");

            MessageBox.Show(m_mainform.objbass.jianceqianzj("", objzj));

        }

        private void button2_Click(object sender, EventArgs e)
        {
            加载减速法自检 f = new 加载减速法自检();
            f.m_mainform = this.m_mainform;
            f.dateTimePicker1.Value = this.dateTimePicker1.Value;
            f.dateTimePicker2.Value = this.dateTimePicker2.Value;
            f.ShowDialog();
            //iniclass objini = new iniclass();
            //string path = "";
            //path = System.Windows.Forms.Application.StartupPath + "\\检测自检\\加载减速设备自检信息.ini";
            //string path1 = string.Format(@"{0}", path);
            //objini.Ini(path1);
            //model.尾气自检.检测前自检.zijianlug objzj = new model.尾气自检.检测前自检.zijianlug();
            //objzj.bzjbz = true;
            //objzj.StationCode = m_mainform.stationCode;
            //objzj.SceneCode = m_mainform.lineCode;
            //objzj.ACDT40 = objini.ReadValue("记录", "ACDT40").Trim();
            //objzj.CCDT40 = objini.ReadValue("记录", "CCDT40").Trim();
            //objzj.CDT40_Error = objini.ReadValue("记录", "CDT40_Error").Trim();
            //objzj.CDT40_Judge = objini.ReadValue("记录", "CDT40_Judge").Trim();
            //objzj.ACDT56 = objini.ReadValue("记录", "ACDT56").Trim();
            //objzj.CCDT56 = objini.ReadValue("记录", "CCDT56").Trim();
            //objzj.CDT56_Error = objini.ReadValue("记录", "CDT56_Error").Trim();
            //objzj.CDT56_Judge = objini.ReadValue("记录", "CDT56_Judge").Trim();
            //objzj.PLHP24 = objini.ReadValue("记录", "PLHP24").Trim();
            //objzj.PLHP32 = objini.ReadValue("记录", "PLHP32").Trim();
            //objzj.PLHP40 = objini.ReadValue("记录", "PLHP40").Trim();
            //objzj.PLHP48 = objini.ReadValue("记录", "PLHP48").Trim();
            //objzj.PLHP56 = objini.ReadValue("记录", "PLHP56").Trim();
            //objzj.PLHP64 = objini.ReadValue("记录", "PLHP64").Trim();
            //objzj.PLHP72 = objini.ReadValue("记录", "PLHP72").Trim();
            //objzj.PLHP80 = objini.ReadValue("记录", "PLHP80").Trim();
            //objzj.PLHP88 = objini.ReadValue("记录", "PLHP88").Trim();
            //objzj.PressureGage_Judge = objini.ReadValue("记录", "PressureGage_Judge").Trim();
            //objzj.N30 = objini.ReadValue("记录", "N30").Trim();
            //objzj.N30_Error = objini.ReadValue("记录", "N30_Error").Trim();
            //objzj.N30_Judge = objini.ReadValue("记录", "N30_Judge").Trim();
            //objzj.N50 = objini.ReadValue("记录", "N50").Trim();
            //objzj.N50_Error = objini.ReadValue("记录", "N50_Error").Trim();
            //objzj.N50_Judge = objini.ReadValue("记录", "N50_Judge").Trim();
            //objzj.N70 = objini.ReadValue("记录", "N70").Trim();
            //objzj.N70_Error = objini.ReadValue("记录", "N70_Error").Trim();
            //objzj.N70_Judge = objini.ReadValue("记录", "N70_Judge").Trim();
            //objzj.N1000 = objini.ReadValue("记录", "N1000").Trim();
            //objzj.N1000_Error = objini.ReadValue("记录", "N1000_Error").Trim();
            //objzj.N1000_Judge = objini.ReadValue("记录", "N1000_Judge").Trim();
            //objzj.N2000 = objini.ReadValue("记录", "N2000").Trim();
            //objzj.N2000_Error = objini.ReadValue("记录", "N2000_Error").Trim();
            //objzj.N2000_Judge = objini.ReadValue("记录", "N2000_Judge").Trim();
            //objzj.N3000 = objini.ReadValue("记录", "N3000").Trim();
            //objzj.N3000_Error = objini.ReadValue("记录", "N3000_Error").Trim();
            //objzj.N3000_Judge = objini.ReadValue("记录", "N3000_Judge").Trim();
            //objzj.N4000 = objini.ReadValue("记录", "N4000").Trim();
            //objzj.N4000_Error = objini.ReadValue("记录", "N4000_Error").Trim();
            //objzj.N4000_Judge = objini.ReadValue("记录", "N4000_Judge").Trim();
            //objzj.Judge = objini.ReadValue("记录", "Judge").Trim();
            ////objzj.CheckTimeStart = objini.ReadValue("记录", "CheckTimeStart").Trim();
            ////objzj.CheckTimeEnd = objini.ReadValue("记录", "CheckTimeEnd").Trim();
            //objzj.CheckTimeStart = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker1.Value.ToString("HH:mm:ss");
            //objzj.CheckTimeEnd = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker2.Value.ToString("HH:mm:ss");
            //MessageBox.Show(m_mainform.objbass.jianceqianzj("", objzj));
        }

        private void button3_Click(object sender, EventArgs e)
        {
            稳态工况法自检 f = new 稳态工况法自检();
            f.m_mainform = this.m_mainform;
            f.dateTimePicker1.Value = this.dateTimePicker1.Value;
            f.dateTimePicker2.Value = this.dateTimePicker2.Value;
            f.ShowDialog();
            //iniclass objini = new iniclass();
            //string path = "";
            //path = System.Windows.Forms.Application.StartupPath + "\\检测自检\\稳态工况设备自检信息.ini";
            //string path1 = string.Format(@"{0}", path);
            //objini.Ini(path1);
            //model.尾气自检.检测前自检.ziasm objzj = new model.尾气自检.检测前自检.ziasm();
            //objzj.bzjbz = true;
            //objzj.StationCode = m_mainform.stationCode;
            //objzj.SceneCode = m_mainform.lineCode;
            //objzj.ACDT40 = objini.ReadValue("记录", "ACDT40").Trim();
            //objzj.CCDT40 = objini.ReadValue("记录", "CCDT40").Trim();
            //objzj.CDT40_Error = objini.ReadValue("记录", "CDT40_Error").Trim();
            //objzj.CDT40_Judge = objini.ReadValue("记录", "CDT40_Judge").Trim();
            //objzj.ACDT25 = objini.ReadValue("记录", "ACDT25").Trim();
            //objzj.CCDT25 = objini.ReadValue("记录", "CCDT25").Trim();
            //objzj.CDT25_Error = objini.ReadValue("记录", "CDT25_Error").Trim();
            //objzj.CDT25_Judge = objini.ReadValue("记录", "CDT25_Judge").Trim();
            //objzj.PLHP25 = objini.ReadValue("记录", "PLHP25").Trim();
            //objzj.PLHP40 = objini.ReadValue("记录", "PLHP40").Trim();
            //objzj.PressureGage_Judge = objini.ReadValue("记录", "PressureGage_Judge").Trim();
            //objzj.Low_HC = objini.ReadValue("记录", "Low_HC").Trim();
            //objzj.Low_HC_Error = objini.ReadValue("记录", "Low_HC_Error").Trim();
            //objzj.Low_HC_Judge = objini.ReadValue("记录", "Low_HC_Judge").Trim();
            //objzj.Low_CO = objini.ReadValue("记录", "Low_CO").Trim();
            //objzj.Low_CO_Error = objini.ReadValue("记录", "Low_CO_Error").Trim();
            //objzj.Low_CO_Judge = objini.ReadValue("记录", "Low_CO_Judge").Trim();
            //objzj.Low_NO = objini.ReadValue("记录", "Low_NO").Trim();
            //objzj.Low_NO_Error = objini.ReadValue("记录", "Low_NO_Error").Trim();
            //objzj.Low_NO_Judge = objini.ReadValue("记录", "Low_NO_Judge").Trim();
            //objzj.ML_HC = objini.ReadValue("记录", "ML_HC").Trim();
            //objzj.ML_HC_Error = objini.ReadValue("记录", "ML_HC_Error").Trim();
            //objzj.ML_HC_Judge = objini.ReadValue("记录", "ML_HC_Judge").Trim();
            //objzj.ML_CO = objini.ReadValue("记录", "ML_CO").Trim();
            //objzj.ML_CO_Error = objini.ReadValue("记录", "ML_CO_Error").Trim();
            //objzj.ML_CO_Judge = objini.ReadValue("记录", "ML_CO_Judge").Trim();
            //objzj.ML_NO = objini.ReadValue("记录", "ML_NO").Trim();
            //objzj.ML_NO_Error = objini.ReadValue("记录", "ML_NO_Error").Trim();
            //objzj.ML_NO_Judge = objini.ReadValue("记录", "ML_NO_Judge").Trim();
            //objzj.Medium_HC = objini.ReadValue("记录", "Medium_HC").Trim();
            //objzj.Medium_HC_Error = objini.ReadValue("记录", "Medium_HC_Error").Trim();
            //objzj.Medium_HC_Judge = objini.ReadValue("记录", "Medium_HC_Judge").Trim();
            //objzj.Medium_CO = objini.ReadValue("记录", "Medium_CO").Trim();
            //objzj.Medium_CO_Error = objini.ReadValue("记录", "Medium_CO_Error").Trim();
            //objzj.Medium_CO_Judge = objini.ReadValue("记录", "Medium_CO_Judge").Trim();
            //objzj.Medium_NO = objini.ReadValue("记录", "Medium_NO").Trim();
            //objzj.Medium_NO_Error = objini.ReadValue("记录", "Medium_NO_Error").Trim();
            //objzj.Medium_NO_Judge = objini.ReadValue("记录", "Medium_NO_Judge").Trim();
            //objzj.MH_HC = objini.ReadValue("记录", "MH_HC").Trim();
            //objzj.MH_HC_Error = objini.ReadValue("记录", "MH_HC_Error").Trim();
            //objzj.MH_HC_Judge = objini.ReadValue("记录", "MH_HC_Judge").Trim();
            //objzj.MH_CO = objini.ReadValue("记录", "MH_CO").Trim();
            //objzj.MH_CO_Error = objini.ReadValue("记录", "MH_CO_Error").Trim();
            //objzj.MH_CO_Judge = objini.ReadValue("记录", "MH_CO_Judge").Trim();
            //objzj.MH_NO = objini.ReadValue("记录", "MH_NO").Trim();
            //objzj.MH_NO_Error = objini.ReadValue("记录", "MH_NO_Error").Trim();
            //objzj.MH_NO_Judge = objini.ReadValue("记录", "MH_NO_Judge").Trim();
            //objzj.High_HC = objini.ReadValue("记录", "High_HC").Trim();
            //objzj.High_HC_Error = objini.ReadValue("记录", "High_HC_Error").Trim();
            //objzj.High_HC_Judge = objini.ReadValue("记录", "High_HC_Judge").Trim();
            //objzj.High_CO = objini.ReadValue("记录", "High_CO").Trim();
            //objzj.High_CO_Error = objini.ReadValue("记录", "High_CO_Error").Trim();
            //objzj.High_CO_Judge = objini.ReadValue("记录", "High_CO_Judge").Trim();
            //objzj.High_NO = objini.ReadValue("记录", "High_NO").Trim();
            //objzj.High_NO_Error = objini.ReadValue("记录", "High_NO_Error").Trim();
            //objzj.High_NO_Judge = objini.ReadValue("记录", "High_NO_Judge").Trim();
            //objzj.N1000 = objini.ReadValue("记录", "N1000").Trim();
            //objzj.N1000_Error = objini.ReadValue("记录", "N1000_Error").Trim();
            //objzj.N1000_Judge = objini.ReadValue("记录", "N1000_Judge").Trim();
            //objzj.N2000 = objini.ReadValue("记录", "N2000").Trim();
            //objzj.N2000_Error = objini.ReadValue("记录", "N2000_Error").Trim();
            //objzj.N2000_Judge = objini.ReadValue("记录", "N2000_Judge").Trim();
            //objzj.N3000 = objini.ReadValue("记录", "N3000").Trim();
            //objzj.N3000_Error = objini.ReadValue("记录", "N3000_Error").Trim();
            //objzj.N3000_Judge = objini.ReadValue("记录", "N3000_Judge").Trim();
            //objzj.N4000 = objini.ReadValue("记录", "N4000").Trim();
            //objzj.N4000_Error = objini.ReadValue("记录", "N4000_Error").Trim();
            //objzj.N4000_Judge = objini.ReadValue("记录", "N4000_Judge").Trim();
            //objzj.Judge = objini.ReadValue("记录", "Judge").Trim();
            ////objzj.CheckTimeStart = objini.ReadValue("记录", "CheckTimeStart").Trim();
            ////objzj.CheckTimeEnd = objini.ReadValue("记录", "CheckTimeEnd").Trim();
            //objzj.Zero_HC = objini.ReadValue("记录", "Zero_HC").Trim();
            //objzj.Zero_HC_Error = objini.ReadValue("记录", "Zero_HC_Error").Trim();
            //objzj.Zero_HC_Judge = objini.ReadValue("记录", "Zero_HC_Judge").Trim();
            //objzj.Zero_CO = objini.ReadValue("记录", "Zero_CO").Trim();
            //objzj.Zero_CO_Error = objini.ReadValue("记录", "Zero_CO_Error").Trim();
            //objzj.Zero_CO_Judge = objini.ReadValue("记录", "Zero_CO_Judge").Trim();
            //objzj.Zero_NO = objini.ReadValue("记录", "Zero_NO").Trim();
            //objzj.Zero_NO_Error = objini.ReadValue("记录", "Zero_NO_Error").Trim();
            //objzj.Zero_NO_Judge = objini.ReadValue("记录", "Zero_NO_Judge").Trim();
            //objzj.CheckTimeStart = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker1.Value.ToString("HH:mm:ss");
            //objzj.CheckTimeEnd = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker2.Value.ToString("HH:mm:ss");


            //MessageBox.Show(m_mainform.objbass.jianceqianzj("", objzj));
        }

        private void button4_Click(object sender, EventArgs e)
        {
            iniclass objini = new iniclass();
            string path = "";
            path = System.Windows.Forms.Application.StartupPath + "\\检测自检\\双怠速设备自检信息.ini";
            string path1 = string.Format(@"{0}", path);
            objini.Ini(path1);
            model.尾气自检.检测前自检.zijiansds objzj = new model.尾气自检.检测前自检.zijiansds();
            objzj.bzjbz = true;
            objzj.StationCode = m_mainform.stationCode;
            objzj.SceneCode = m_mainform.lineCode;
            objzj.Low_HC = objini.ReadValue("记录", "Low_HC").Trim();
            objzj.Low_HC_Error = objini.ReadValue("记录", "Low_HC_Error").Trim();
            objzj.Low_HC_Judge = objini.ReadValue("记录", "Low_HC_Judge").Trim();
            objzj.Low_CO = objini.ReadValue("记录", "Low_CO").Trim();
            objzj.Low_CO_Error = objini.ReadValue("记录", "Low_CO_Error").Trim();
            objzj.Low_CO_Judge = objini.ReadValue("记录", "Low_CO_Judge").Trim();
            objzj.ML_HC = objini.ReadValue("记录", "ML_HC").Trim();
            objzj.ML_HC_Error = objini.ReadValue("记录", "ML_HC_Error").Trim();
            objzj.ML_HC_Judge = objini.ReadValue("记录", "ML_HC_Judge").Trim();
            objzj.ML_CO = objini.ReadValue("记录", "ML_CO").Trim();
            objzj.ML_CO_Error = objini.ReadValue("记录", "ML_CO_Error").Trim();
            objzj.ML_CO_Judge = objini.ReadValue("记录", "ML_CO_Judge").Trim();
            objzj.Medium_HC = objini.ReadValue("记录", "Medium_HC").Trim();
            objzj.Medium_HC_Error = objini.ReadValue("记录", "Medium_HC_Error").Trim();
            objzj.Medium_HC_Judge = objini.ReadValue("记录", "Medium_HC_Judge").Trim();
            objzj.Medium_CO = objini.ReadValue("记录", "Medium_CO").Trim();
            objzj.Medium_CO_Error = objini.ReadValue("记录", "Medium_CO_Error").Trim();
            objzj.Medium_CO_Judge = objini.ReadValue("记录", "Medium_CO_Judge").Trim();
            objzj.MH_HC = objini.ReadValue("记录", "MH_HC").Trim();
            objzj.MH_HC_Error = objini.ReadValue("记录", "MH_HC_Error").Trim();
            objzj.MH_HC_Judge = objini.ReadValue("记录", "MH_HC_Judge").Trim();
            objzj.MH_CO = objini.ReadValue("记录", "MH_CO").Trim();
            objzj.MH_CO_Error = objini.ReadValue("记录", "MH_CO_Error").Trim();
            objzj.MH_CO_Judge = objini.ReadValue("记录", "MH_CO_Judge").Trim();
            objzj.High_HC = objini.ReadValue("记录", "High_HC").Trim();
            objzj.High_HC_Error = objini.ReadValue("记录", "High_HC_Error").Trim();
            objzj.High_HC_Judge = objini.ReadValue("记录", "High_HC_Judge").Trim();
            objzj.High_CO = objini.ReadValue("记录", "High_CO").Trim();
            objzj.High_CO_Error = objini.ReadValue("记录", "High_CO_Error").Trim();
            objzj.High_CO_Judge = objini.ReadValue("记录", "High_CO_Judge").Trim();
            objzj.N1000 = objini.ReadValue("记录", "N1000").Trim();
            objzj.N1000_Error = objini.ReadValue("记录", "N1000_Error").Trim();
            objzj.N1000_Judge = objini.ReadValue("记录", "N1000_Judge").Trim();
            objzj.N2000 = objini.ReadValue("记录", "N2000").Trim();
            objzj.N2000_Error = objini.ReadValue("记录", "N2000_Error").Trim();
            objzj.N2000_Judge = objini.ReadValue("记录", "N2000_Judge").Trim();
            objzj.N3000 = objini.ReadValue("记录", "N3000").Trim();
            objzj.N3000_Error = objini.ReadValue("记录", "N3000_Error").Trim();
            objzj.N3000_Judge = objini.ReadValue("记录", "N3000_Judge").Trim();
            objzj.N4000 = objini.ReadValue("记录", "N4000").Trim();
            objzj.N4000_Error = objini.ReadValue("记录", "N4000_Error").Trim();
            objzj.N4000_Judge = objini.ReadValue("记录", "N4000_Judge").Trim();
            objzj.Judge = objini.ReadValue("记录", "Judge").Trim();
            //objzj.CheckTimeStart = objini.ReadValue("记录", "CheckTimeStart").Trim();
            //objzj.CheckTimeEnd = objini.ReadValue("记录", "CheckTimeEnd").Trim();
            objzj.Zero_HC = objini.ReadValue("记录", "Zero_HC").Trim();
            objzj.Zero_HC_Error = objini.ReadValue("记录", "Zero_HC_Error").Trim();
            objzj.Zero_HC_Judge = objini.ReadValue("记录", "Zero_HC_Judge").Trim();
            objzj.Zero_CO = objini.ReadValue("记录", "Zero_CO").Trim();
            objzj.Zero_CO_Error = objini.ReadValue("记录", "Zero_CO_Error").Trim();
            objzj.Zero_CO_Judge = objini.ReadValue("记录", "Zero_CO_Judge").Trim();
            objzj.CheckTimeStart = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker1.Value.ToString("HH:mm:ss");
            objzj.CheckTimeEnd = DateTime.Now.ToString("yyyy-MM-dd") + " " + dateTimePicker2.Value.ToString("HH:mm:ss");

            MessageBox.Show(m_mainform.objbass.jianceqianzj("", objzj));
        }

        private void button5_Click(object sender, EventArgs e)
        {
            MessageBox.Show(m_mainform.objbass.JCZT(""));
        }

        private void 检测方法自检_Load(object sender, EventArgs e)
        {
            dateTimePicker1.Value = DateTime.Now.AddHours(-0.5);
            dateTimePicker2.Value = DateTime.Now;
        }
    }
}